import Vue from 'vue'
import vuex from 'vuex'

Vue.use(vuex)

export default new vuex.Store({
  strict: true,
  state: {
    count: 0
  },
  mutations: {
    addCount (state, arg) {
      state.count++
    },
    minusCount (state, arg) {
      state.count--
    }
  },
  actions: {
    // 这里的函数名和mutations的名字没关系
    addCount (state, arg) {
      console.log(state)
    },
    minusCount (state, arg) {
      console.log(state)
    }
  },
  getter: {}
})
